package ucm.controller;

import java.security.NoSuchAlgorithmException;
import javax.swing.JOptionPane;
import ucm.module.UC_SelInfoM;

public class UC_SelInfoC {
    private String id = null;
    private String end_city = null;
    private String start_time = null;
    private String userid = null;



    public UC_SelInfoC(String start_time,String end_city) throws NoSuchAlgorithmException {
        this.end_city = end_city;
        this.start_time = start_time;
    }

    public UC_SelInfoC(String id) {
        this.id = id;
    }

    public UC_SelInfoC(String userid,boolean type) {
        this.userid = userid;
    }



    public void selectAll() 
    {
        UC_SelInfoM uc_sim = new UC_SelInfoM();
        uc_sim.selectByAll(userid);
    }
    
    public void selectAllByCon()
    {
        if (end_city.equals("") && start_time.equals(""))
        {
            JOptionPane.showMessageDialog(null, "Please input select condition!");
        }

        UC_SelInfoM uc_sim = new UC_SelInfoM();
        uc_sim.selectAllByCon(start_time,end_city);
    }

    public void selectById() {
        if (id.equals("")) {
            JOptionPane.showMessageDialog(null, "Please input select condition!");
        }
        UC_SelInfoM uc_sim = new UC_SelInfoM();
        uc_sim.selectById(id);
    }
}
